package com.epcs.model.bo;

import java.util.List;

import com.epcs.model.dao.EmailDAO;
import com.epcs.model.dto.Account;
import com.epcs.model.dto.Email;

public class EmailBO {

	public boolean insertEmail(Email email) {

		EmailDAO dao = new EmailDAO();

		return dao.insertEmailToDB(email);
	}

	public List<Email> getAllEmail(Account account) {

		EmailDAO dao = new EmailDAO();

		return dao.getAllEmailFromDB(account);
	}

	public boolean updateEmail(Email email) {

		EmailDAO dao = new EmailDAO();

		return dao.updateEmailToDB(email);
	}
	
	public Email getEmail(int emailId) {
		
		EmailDAO dao = new EmailDAO();
		
		return dao.getEmailById(emailId);
	}
	
	public boolean deleteEmail(Email email) {
		
		EmailDAO dao = new EmailDAO();
		
		return dao.deleteEmailFromDB(email);
	}
}
